<%@page import="com.DBtools"%>
<%@ page language="java" contentType="text/html ; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="java.sql.*" %>  
    <%-- <jsp:include page="../header.jsp"></jsp:include> --%>
    <!-- 这是一个教师账号管理 -->
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>教师账号管理</title>
	<link href="Style.css" rel="stylesheet" type="text/css" />
	<!-- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
	<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
	<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js" integrity="sha384-cuYeSxntonz0PPNlHhBs68uyIAVpIIOZZ5JqeqvYYIcEL727kskC66kF92t6Xl2V" crossorigin="anonymous"></script> -->
</head>
<body>
<h6 align="center">教师用户管理</h6>

<hr>
<a href="teachdit.jsp?bol=<%="0"%>">新增教师</a>
<% 
ResultSet rs = new DBtools().query("select * from teacher,user where TeaId=UserNum");
%>
<table border="2" width="50%" align="center" class="imagetable">
 <tr >
            <th>工号/账号</th>
            <th>教师姓名</th> 
            <th>账号密码</th>
            <th>所属学院</th>
            <th colspan="2" width="70">操作</th>
        </tr>
<%while(rs.next()){
	String TeaId = rs.getString("TeaId");
%>
<tr onClick="rowclick(this)">	<!-- 点击行传递数据 -->
	<td> <%=rs.getString("TeaId")%>  </td>
	<td> <%=rs.getString("TeaName")%>  </td>
	<td> <%=rs.getString("UserPwd")%>  </td>
	<td> <%=rs.getString("DepName")%><%//选择学院 %></td>
	<%

	%>
	
	<td align="center"><a href="../TeaDel?TeaId=<%=TeaId%>" onClick="return confirm('请确认是否删除当前记录')">删除</a></td>
	<td align="center"><a href="teachdit.jsp?TeaId=<%=TeaId%>&bol=<%="1"%>">修改</a></td>

	
</tr>
<%}%>
</table>
<% 
rs.close();
/*方1 关闭资源
stmt.close();
conn.close(); 
*/
%>

<br>
<form action="../TeaOperate" method="post" >
<table width="400" algin="center" border="1">
<tr>
<td with="120">工号</td>
<td><input type="text" name="TeaId" id="TeaId" ></td>
</tr>
<tr>
<td>姓名</td>
<td><input type="text" name="TeaName"  id="TeaName"></td>

</tr>
<tr>
<td>密码</td>
<td><input type="text" name="UserPwd"  id="UserPwd"></td>
</tr>
<tr>
<td>学院</td>
<td><input type="text" name="TeaName"  id="DepName"  >
</td>
</tr>
 </table>
 </form>
</body>
<script type="text/javascript">
function rowclick(row) {
	/* console.info(row);
	console.info(ro.tagName); */
	TeaId.value=row.children[0].innerText;
	TeaName.value=row.children[1].innerText;
	UserPwd.value=row.children[2].innerText;
	DepName.value=row.children[3].innerText;
	
}

</script>

</html>







